CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
CMAKE_POLICY(VERSION 2.6)
FIND_PACKAGE(Torch REQUIRED)
FIND_PACKAGE(HDF5 1.8 REQUIRED)

ADD_SUBDIRECTORY("luasrc")

INSTALL(CODE "MESSAGE(\"-- Generating \" ${CMAKE_INSTALL_PREFIX}/${Torch_INSTALL_LUA_PATH_SUBDIR}/hdf5/config.lua)
FILE(WRITE ${CMAKE_INSTALL_PREFIX}/${Torch_INSTALL_LUA_PATH_SUBDIR}/hdf5/config.lua \"hdf5._config = {
    HDF5_INCLUDE_PATH = \\\"${HDF5_INCLUDE_DIR}\\\",
    HDF5_LIBRARIES = \\\"${HDF5_LIBRARIES}\\\"
}\n\")")
